package viewIHM;

import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;

public class ActionList implements ListSelectionListener {

	private ChatGUIView fenetre ;
	
	public ActionList(ChatGUIView fenetre){
		this.fenetre = fenetre ;
	}
	@Override
	public void valueChanged(ListSelectionEvent e) {
	    if (e.getValueIsAdjusting() == false) {

	        if (fenetre.getJList().getSelectedIndex() == -1) {
	        	fenetre.disableOpenButton();	            
	        } else {
	        	fenetre.enableOpenButton();
	        }
	    }
	}

}
